package com.own.business.wallet.controller.user.form;

import com.own.component.common.exception.BusinessSimpleException;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * ChangePayPasswordForm
 *
 * @author chenxueli
 * @date 2023-11-04 15:43:00
 */
@Data
public class ChangePayPasswordForm implements Serializable {

    @Schema(title = "秘钥key")
    private String key;

    @Schema(title = "新密码")
    private String password;

    @Schema(title = "修改信息的令牌")
    private String token;

    public void check() {
        if (StringUtils.isBlank(key)) {
            throw new BusinessSimpleException("秘钥key不能为空");
        }
        if (StringUtils.isBlank(password)) {
            throw new BusinessSimpleException("新密码不能为空");
        }
        if (StringUtils.isBlank(token)) {
            throw new BusinessSimpleException("修改信息的令牌不能为空");
        }
    }

}
